<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <p>类的继承</p>
    <script>
        // 将构造函数改造成类
        // 父类
        class Person {
            constructor(gj) {
                this.gj = gj;
                this.foot = 2;
            }
            say() {
                console.log('abaaba');
            }
            static treeing() {
                console.log('爬树');
            }
        }
        // 子类
        class HenanRen extends Person{
            constructor() {
                super('c');
                console.log(this);
                super.say()
            }
        }

        // 创建子类的实例
        let zzRen = new HenanRen();
        console.log(zzRen);
    </script>
</body>
</html>